<?php
/**
 * Created by yuxianjun001@icloud.com.
 * User: wuchen
 * Date: 2019/4/1
 * Time: 10:53
 */

namespace App\Http\Controllers\Api\Goods;
use App\Http\Controllers\Common\MyController;
use App\Services\Goods\PlatFormGoodsService;
use Illuminate\Http\Request;

/**
 * 平台后端 商品模块
 * Class PlatFormGoods
 * @package App\Http\Controllers\Api\Goods
 */
class PlatFormGoodsController  extends MyController
{
    private $service;

    public function __construct()
    {
        $this->service = new PlatFormGoodsService();
    }

    /**
     * 新增商品
     * @param Request $request
     */
    public function add(Request $request){
         return $this->service->add($request);

    }

    /**
     * 编辑商品
     * @param Request $reques
     */
    public function edit(Request $request){
        return $this->service->edit($request);
    }

    /**
     * 删除商品
     * @param Request $reques
     */
    public function del(Request $request){
        return $this->service->del($request);
    }


    /**
     * 商品上架，下架
     * @param Request $request
     */
    public function upAndDown(Request $request){
        return $this->service->upAndDown($request);
    }

    /**
     * 商品列表
     * @param Request $request
     * @return array
     */
    public function list(Request $request){
        return $this->service->list($request);
    }

    /**
     * 商品详情，还需补充统计信息
     * @param Request $request
     * @return mixed
     */
    public function info(Request $request){
        return $this->service->info($request);
    }

    /**
     * 特惠活动列表
     * @param Request $request
     * @return mixed
     */
    public function promotionList(Request $request)
    {
        return $this->service->promotionList($request);
    }

    /**
     * 申请特惠列表
     * @param Request $request
     * @return mixed
     */
    public function operationPromotionList(Request $request)
    {
        return $this->service->operationPromotionList($request);
    }

    /**
     * 同意特惠申请
     * @param Request $request
     */
    public function agreePromotion(Request $request)
    {
        return $this->service->agreePromotion($request);
    }

}